package com.rpp.service.serviceImpl;

import com.rpp.dao.ArticleRepository;
import com.rpp.entity.Article;
import com.rpp.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

/**
 * @Description
 * @Author rpp
 * @Date 2020/7/14 10:30 下午
 */
@Service
public class ArticleServiceImpl implements ArticleService {

    @Autowired
    ArticleRepository articleRepository;

    @Override
    public Page<Article> findArticleByPage(Integer pageNum, Integer pageSize) {

        Page<Article> page = articleRepository.findAll(PageRequest.of(pageNum, pageSize));
        return page;
    }
}
